package com.coding.springboot.demo.service;

import com.coding.springboot.demo.dao.TaccountRepository;
import com.coding.springboot.demo.entity.Taccount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by qince on 2015/8/10.
 */
@Service
@Transactional
public class TaccountService {
    @Autowired
    private TaccountRepository taccountRepository;

    @Cacheable(value = "accountCache",key="'taccount.findByName_' + #name")
    public Taccount findByName(String name) {
        return this.taccountRepository.findByName(name);
    }
}
